import Vue from 'vue'
import Router from 'vue-router'

const Home = r => require.ensure([], () => r(require('@/pages/home/index')), 'home')
const Basket = r => require.ensure([], () => r(require('@/pages/basket/index')), 'basket')
const Foot = r => require.ensure([], () => r(require('@/pages/foot/index')), 'foot')
const About = r => require.ensure([], () => r(require('@/pages/about/index')), 'about')
const Show = r => require.ensure([], () => r(require('@/pages/show/index')), 'show')
const Login = r => require.ensure([], () => r(require('@/pages/login/index')), 'login')
const Register = r => require.ensure([], () => r(require('@/pages/register/index')), 'register')
const Ranking = r => require.ensure([], () => r(require('@/pages/ranking/index')), 'ranking')
const Order = r => require.ensure([], () => r(require('@/pages/order/index')), 'order')
const Help = r => require.ensure([], () => r(require('@/pages/help/index')), 'help')

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      component: Home
    },
    {
      path: '/basket',
      component: Basket
    },
    {
      path: '/foot',
      component: Foot
    },
    {
      path: '/about',
      component: About
    },
    {
      path: '/show',
      component: Show
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    },
    {
      path: '/ranking',
      component: Ranking
    },
    {
      path: '/order',
      component: Order
    },
    {
      path: '/help',
      component: Help
    }
  ]
})
